<template>
  <div>
    <!-- Form -->
    <el-button type="text" @click="findById(),dialogFormVisible = true">打开嵌套表单的 Dialog</el-button>

    <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
      <el-form :model="form">
        <el-form-item label="活动名称" :label-width="formLabelWidth">
          <el-input v-model="form.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="活动区域" :label-width="formLabelWidth">
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option v-for="re in form.re"
                       :lable="re.lable"
                       :value = "re.value"
                       :key="re.name">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="addData(),dialogFormVisible = false">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: '5.ElementUI-Dialog',
  components: {},
  data () {
    return {
      dialogFormVisible: false,
      addData: [],
      formLabelWidth: '120px',
      form: {
        name: ''
      }
    }
  },
  methods: {
    findById () {
      this.form = {
        name: '刘宗燚',
        re: [{ name: '活动一', value: '成都' }, { name: '活动二', value: '四川' }]
      }
    }
  }
}
</script>

<style scoped>

</style>
